package com.ardf.service;

import com.ardf.entity.Rule;
import com.ardf.entity.dto.RuleInfoDto;
import com.ardf.entity.dto.RuleProjectMenuDto;
import com.ardf.entity.dto.RuleTableDto;
import com.ardf.entity.vo.RuleUpdateVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author ShiYunHao
 * @since 2025-01-06
 */
public interface IRuleService extends IService<Rule> {

    /**
     *分页
     */
    Page<RuleTableDto> searchAll(Integer pageSize, Integer pageNum, Long competitionId, Long projectId);
    /**
     * 批量新增
     */
    void addByBatch(List<Rule> rules);
    /**
     * 批量删除
     */
    void deleteByBatch(List<Long> ids);
    /**
     * 获取项目菜单
     */
    List<RuleProjectMenuDto> getProjectMenu(Long competitionId);

    /**
     * 更新
     * @param ruleUpdateVo
     */
    void updateRule(RuleUpdateVo ruleUpdateVo);

    /**
     * 导出规则表
     */
    void download(HttpServletResponse response, Long competitionId) throws IOException;
    /**
     * 获取规则信息（比赛详情页面需要）
     */
    RuleInfoDto getRuleInfo(Long ruleId);
}
